package com.pureut.production.controller;

import com.pureut.common.core.web.controller.BaseController;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.common.core.web.page.TableDataInfo;
import com.pureut.common.log.annotation.Log;
import com.pureut.common.log.enums.BusinessType;
import com.pureut.production.domain.dto.MasterRollSplicingDto;
import com.pureut.production.service.IMasterRollSplicingService;
import com.pureut.production.domain.vo.MasterRollSplicingVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 * @Author: YSL
 * @Date: 2023-02-09 11:25:57
 * @Desc: 母卷拼接Controller
 */
@RestController
@RequestMapping("/masterRollSplicing")
public class MasterRollSplicingController extends BaseController {

    /**
     * 母卷拼接service
     */
    @Resource
    IMasterRollSplicingService masterRollSplicingService;


    /**
     * 查看母卷拼接列表
     */
    @GetMapping("/list")
    public TableDataInfo selectOperationList(MasterRollSplicingVo masterRollSplicingVo) {
        startPage();
        // 查看母卷拼接列表
        List<MasterRollSplicingDto> masterRollSplicingDtos = masterRollSplicingService.selectMasterRollList(masterRollSplicingVo);
        return getDataTable(masterRollSplicingDtos);
    }

    /**
     * 新增母卷拼接
     */
    // @RequiresPermissions("rollLengthChange:information:add")
    @Log(title = "新增母卷拼接", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@Validated @RequestBody MasterRollSplicingVo masterRollSplicingVo){
        return toAjax(masterRollSplicingService.add(masterRollSplicingVo));
    }

}
